<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>添加新账号</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<link rel="stylesheet" href="assets/layui/css/layui.css">
	<link rel="stylesheet" href="assets/css/all.css" />
</head>
<body class="add-new-account">
	<!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
	<!--[if lt IE 9]>
		  <script src="assets/js/html5.min.js"></script>
		  <script src="assets/js/respond.min.js"></script>
		<![endif]-->
	<div class="layui-container">
		<div class="layui-text">
			<h2 class="layui-field-title" style="text-align: center;">请详细填写以下内容</h2>
		</div>
		<form class="layui-form" action="" onsubmit="return false;">
			<div class="layui-form-item">
				<label class="layui-form-label">账号</label>
				<div class="layui-input-block">
					<input id="inaccount" type="text" name="" lay-verify="required|inaccount" autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">密码</label>
				<div class="layui-input-block">
					<input id="inpass" type="text" name="" lay-verify="required|inpass" autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">确认密码</label>
				<div class="layui-input-block">
					<input id="inpassagain" type="text" name="" lay-verify="required|inpassagain" autocomplete="off" class="layui-input">
				</div>
			</div>	
			<div class="layui-form-item">
				<!--<div class="choose-area">
					<label class="layui-form-label">地区</label>
					<div class="layui-input-inline">
						<select name="" id="provid">
							<option value="">请选择</option>
							<option value="1">北京</option>
							<option value="2">天津</option>
							<option value="3">河北</option>
							<option value="4">河南</option>
						</select>
					</div>
				</div>
				<div class="layui-input-inline">
					<button class="layui-btn" id="addAddress">增加</button>
				</div>-->
				<label class="layui-form-label">地区</label>
				<div class="layui-input-inline">
					<select name="provid" id="provid" lay-filter="provid">
						<option value="">请选择省</option>
					</select>
				</div>
				<div class="layui-input-inline">
					<select name="cityid" id="cityid" lay-filter="cityid">
						<option value="">请选择市</option>
					</select>
				</div>
				<div class="layui-input-inline">
					<select name="areaid" id="areaid" lay-filter="areaid">
						<option value="">请选择县/区</option>
					</select>
				</div>
			</div>		
			
		</form>
		<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
			<legend>权限：系统权限配置</legend>
		</fieldset>
		<ul id="qxlist" style="margin-left: 20px;"></ul>
		<div style="text-align: center;margin:20px auto;">
			<button class="layui-btn">重  置</button>
			<button class="layui-btn" lay-submit lay-filter="submit-btn">添  加</button>
		</div>
	</div>

	<script src="assets/layui/layui.js"></script>
	<script src="assets/js/all.js"></script>
	<!--省市地区选择-->
	<script type="text/javascript" src="assets/js/data.js"></script>
	<script type="text/javascript" src="assets/js/province.js"></script>
	<script type="text/javascript">
		var defaults = {
			s1: 'provid',
			s2: 'cityid',
			s3: 'areaid',
			v1: null,
			v2: null,
			v3: null
		};
	</script>
	<!--//省市地区选择-->   
	<script>
		layui.use(['tree','form','layer'], function() {
			var form = layui.form,
			    layer = layui.layer,
			    $ = layui.$
//			 //点击增加按钮市区增加   
//			$("#addAddress").on("click",function(){				
//				var inputLen = $(".choose-area").find(".layui-input-inline").length;//输入框个数				
//				if(inputLen == 1){//只有省份
//					var provVal = $("#provid option:selected").text();//省份的值
//					if(provVal =="请选择" ){
//						layer.msg("未选择省份");
//					}else{
//						$.ajax({
//							type:"post",
//							url:"",
//                          data:{"provVal":provVal},
//							async:true,
//							success:function(data){															
//								$.each(data, function(i,item) {
//									var cityLine = '<div class="layui-input-inline"><select name="cityid" id="cityid" lay-filter="cityid"><option value="">'+item.val[i]+'</option></select></div>'
//									$(".choose-area").append(cityLine);
//								});
//							}
//						});
//					}
//				}	
//				else if(inputLen == 2){//有省 有市
//					var provVal = $("#provid option:selected").text();//省份的值
//					var cityVal = $("#cityid").text();//市的值
//					if(provVal =="请选择"  ){
//						layer.msg("未选择省份");
//					}
//					else if(cityVal =="请选择"  ){
//						layer.msg("未选择城市");
//					}else if(cityVal =="请选择" || provVal =="请选择"  ){
//						layer.msg("未选择省份和城市");
//					}else{
//						$.ajax({
//							type:"post",
//							url:"",
//                          data:{"cityVal":cityVal},
//							async:true,
//							success:function(data){															
//								$.each(data, function(i,item) {
//									var areaLine = '<div class="layui-input-inline"><select name="areaid" id="areaid" lay-filter="cityid"><option value="">'+item.val[i]+'</option></select></div>'
//									$(".choose-area").append(areaLine);
//								});
//							}
//						});
//					}
//				}else{
//					return false;
//				}
//				
//			})
			    
			//创建账号页面js
			//自定义验证规则
			form.verify({
				inaccount: function(value) {
					if(value.length < 5) {
						return '标题至少得5个字符啊';
					}
				},
				inpass: [/(.+){6,12}$/, '密码必须6到12位'],
				inpassagain:function(value){
					if(value != $("#inpass").val()){
						$("#inpassagain").val('');
						return '确认密码与密码不一致';
					}
				}
			});    
			    			    			    			    						    
			var tree = layui.tree({
				elem: '#qxlist', //指定元素，生成的树放到哪个元素上
				check: 'checkbox', //勾选风格
				skin: 'as', //设定皮肤
				drag: true, //点击每一项时是否生成提示信息
				checkboxName: 'aa[]', //复选框的name属性值
				checkboxStyle: "", //设置复选框的样式，必须为字符串，css样式怎么写就怎么写
				click: function(item) { //点击节点回调
					console.log("item")
				},
				onchange: function() { //当当前input发生变化后所执行的回调
					console.log(this);
				},
				nodes: [ //节点
					{
						name: '管理系統', //节点名称
						spread: false, //是否是展开状态，true为展开状态						
						//href: "", //设置节点跳转的链接，如果不设置则不会跳转
						//target: "_self", //节点链接打开方式
						alias: 'changyong',
						data: { //为元素添加额外数据，即在元素上添加data-xxx="yyy"，可选
							nodeName: "管理系統",
							alias: "changyong"
						},
						checkboxValue: 1, //复选框的值
						checked: false, //复选框默认是否选中
						children: [{
							name: '人员管理',
							spread: false, //是否是展开状态，true为展开状态
							alias: 'renyuan',
							checked: false,
							checkboxValue: 2,
							children:[{
								name:'添加'
							},{
								name:'编辑/修改'
							},{
								name:'删除'
							}]
						}, {
							name: '系统统计',
							spread: false, //是否是展开状态，true为展开状态
							children:[{
								name:'查看'
							},{
								name:'导出'
							}]
						}, {
							name: '公告信息/编辑',
							checked: false,
							checkboxValue: 3
						}]
					}, {
						name: '询残系统',
						checked: false,
						spread: false,
						data: {
							nodeName: "询残系统",
							alias: "xuncan"
						},
						children: [{
							name: '发布车辆信息',
							checked: false,
							checkboxValue: 4,
							spread: false,
							children: [{
								name: '发布',
								checked: false,
								checkboxValue: 5,								
							}, {
								name: '提交审核',
								checked: false,
								checkboxValue: 9
							}, {
								name: '编辑',
								checked: false,
								checkboxValue: 10
							}]
						}, {
							name: '车辆管理',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看详情',
								checked: false,
								checkboxValue: 12
							}, {
								name: '编辑',
								checked: false,
								checkboxValue: 13
							}, {
								name: '确认更改',
								checked: false,
								checkboxValue: 14
							},{
								name:'查看报价清单'
							}]
						},{
							name: '订单管理',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看详情',
								checked: false,
								checkboxValue: 12
							}, {
								name: '查看报价清单',
								checked: false,
								checkboxValue: 13
							}, {
								name: '编辑中标结果',
								checked: false,
								checkboxValue: 14
							},{
								name:'发布中标结果'
							}]
						},{
							name: '系统统计',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看',
								checked: false,
								checkboxValue: 12
							}, {
								name: '导出',
								checked: false,
								checkboxValue: 13
							}]
						}]
					},{
						name: '旧件拍卖系统',
						checked: false,
						spread: false,
						data: {
							nodeName: "旧件拍卖系统",
							alias: "jiujian"
						},
						children: [{
							name: '发布旧件信息',
							checked: false,
							checkboxValue: 4,
							spread: false,
							children: [{
								name: '发布',
								checked: false,
								checkboxValue: 5,								
							}, {
								name: '提交审核',
								checked: false,
								checkboxValue: 9
							}, {
								name: '编辑',
								checked: false,
								checkboxValue: 10
							}]
						}, {
							name: '旧件管理',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看详情',
								checked: false,
								checkboxValue: 12
							}, {
								name: '编辑',
								checked: false,
								checkboxValue: 13
							}, {
								name: '确认更改',
								checked: false,
								checkboxValue: 14
							},{
								name:'查看报价清单'
							}]
						},{
							name: '订单管理',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看详情',
								checked: false,
								checkboxValue: 12
							}, {
								name: '查看报价清单',
								checked: false,
								checkboxValue: 13
							}, {
								name: '编辑中标结果',
								checked: false,
								checkboxValue: 14
							},{
								name:'发布中标结果'
							}]
						},{
							name: '系统统计',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看',
								checked: false,
								checkboxValue: 12
							}, {
								name: '导出',
								checked: false,
								checkboxValue: 13
							}]
						}]
					},{
						name: '送修系统',
						checked: false,
						spread: false,
						data: {
							nodeName: "送修系统",
							alias: "songxiu"
						},
						children: [{
							name: '发布车辆信息',
							checked: false,
							checkboxValue: 4,
							spread: false,
							children: [{
								name: '发布',
								checked: false,
								checkboxValue: 5,								
							}, {
								name: '提交审核',
								checked: false,
								checkboxValue: 9
							}, {
								name: '编辑',
								checked: false,
								checkboxValue: 10
							}]
						}, {
							name: '车辆管理',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看详情',
								checked: false,
								checkboxValue: 12
							}, {
								name: '编辑',
								checked: false,
								checkboxValue: 13
							}, {
								name: '确认更改',
								checked: false,
								checkboxValue: 14
							},{
								name:'查看报价清单'
							}]
						},{
							name: '订单管理',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看详情',
								checked: false,
								checkboxValue: 12
							}, {
								name: '查看报价清单',
								checked: false,
								checkboxValue: 13
							}, {
								name: '编辑中标结果',
								checked: false,
								checkboxValue: 14
							},{
								name:'发布中标结果'
							}]
						},{
							name: '已修复清单',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看详情',
								checked: false,
								checkboxValue: 12
							}, {
								name: '查看报价清单',
								checked: false,
								checkboxValue: 13
							}, {
								name: '查看修复结果',
								checked: false,
								checkboxValue: 14
							}]
						},{
							name: '系统统计',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看',
								checked: false,
								checkboxValue: 12
							}, {
								name: '导出',
								checked: false,
								checkboxValue: 13
							}]
						}]
					},{
						name: '旧件修复系统',
						checked: false,
						spread: false,
						data: {
							nodeName: "旧件修复系统",
							alias: "jiujianxiufu"
						},
						children: [{
							name: '发布旧件信息',
							checked: false,
							checkboxValue: 4,
							spread: false,
							children: [{
								name: '发布',
								checked: false,
								checkboxValue: 5,								
							}, {
								name: '提交审核',
								checked: false,
								checkboxValue: 9
							}, {
								name: '编辑',
								checked: false,
								checkboxValue: 10
							}]
						}, {
							name: '旧件管理',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看详情',
								checked: false,
								checkboxValue: 12
							}, {
								name: '编辑',
								checked: false,
								checkboxValue: 13
							}, {
								name: '确认更改',
								checked: false,
								checkboxValue: 14
							},{
								name:'查看报价清单'
							}]
						},{
							name: '订单管理',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看详情',
								checked: false,
								checkboxValue: 12
							}, {
								name: '查看报价清单',
								checked: false,
								checkboxValue: 13
							}, {
								name: '编辑中标结果',
								checked: false,
								checkboxValue: 14
							},{
								name:'发布中标结果'
							}]
						},{
							name: '已修复清单',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看详情',
								checked: false,
								checkboxValue: 12
							}, {
								name: '查看报价清单',
								checked: false,
								checkboxValue: 13
							}, {
								name: '查看修复结果',
								checked: false,
								checkboxValue: 14
							}]
						},{
							name: '系统统计',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看',
								checked: false,
								checkboxValue: 12
							}, {
								name: '导出',
								checked: false,
								checkboxValue: 13
							}]
						}]
					},{
						name: '调查系统',
						checked: false,
						spread: false,
						data: {
							nodeName: "调查系统",
							alias: "diaocha"
						},
						children: [{
							name: '指派车辆信息',
							checked: false,
							checkboxValue: 4,
							spread: false,
							children: [{
								name: '指派',
								checked: false,
								checkboxValue: 5,								
							}, {
								name: '编辑',
								checked: false,
								checkboxValue: 9
							}]
						}, {
							name: '车辆管理',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看详情',
								checked: false,
								checkboxValue: 12
							}, {
								name: '编辑',
								checked: false,
								checkboxValue: 13
							}, {
								name: '确认更改',
								checked: false,
								checkboxValue: 14
							},{
								name:'查看调查结果'
							}]
						},{
							name: '系统统计',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看',
								checked: false,
								checkboxValue: 12
							}, {
								name: '导出',
								checked: false,
								checkboxValue: 13
							}]
						}]
					},{
						name: '救援系统',
						checked: false,
						spread: false,
						data: {
							nodeName: "救援系统",
							alias: "jiuyuan"
						},
						children: [{
							name: '编辑车辆信息',
							checked: false,
							checkboxValue: 4,
							spread: false,
							children: [{
								name: '指派',
								checked: false,
								checkboxValue: 5,								
							}, {
								name: '编辑',
								checked: false,
								checkboxValue: 9
							}]
						}, {
							name: '车辆管理',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看详情',
								checked: false,
								checkboxValue: 12
							}, {
								name: '编辑',
								checked: false,
								checkboxValue: 13
							}, {
								name: '确认更改',
								checked: false,
								checkboxValue: 14
							},{
								name:'查看调查结果'
							}]
						},{
							name: '系统统计',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看',
								checked: false,
								checkboxValue: 12
							}, {
								name: '导出',
								checked: false,
								checkboxValue: 13
							}]
						}]
					},{
						name: '追偿系统',
						checked: false,
						spread: false,
						data: {
							nodeName: "追偿系统",
							alias: "zhuichang"
						},
						children: [{
							name: '编辑车辆信息',
							checked: false,
							checkboxValue: 4,
							spread: false,
							children: [{
								name: '指派',
								checked: false,
								checkboxValue: 5,								
							}, {
								name: '编辑',
								checked: false,
								checkboxValue: 9
							}]
						}, {
							name: '车辆管理',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看详情',
								checked: false,
								checkboxValue: 12
							}, {
								name: '编辑',
								checked: false,
								checkboxValue: 13
							}, {
								name: '确认更改',
								checked: false,
								checkboxValue: 14
							},{
								name:'查看追偿结果'
							}]
						},{
							name: '系统统计',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看',
								checked: false,
								checkboxValue: 12
							}, {
								name: '导出',
								checked: false,
								checkboxValue: 13
							}]
						}]
					}
				]
			});	
		});
	</script>
</body>
</html>
